<?php 
// Config language (can change it)
$a_Lang['Latest_Review'] = 'Последни мнения';
/*function limit_text($text,$limit = 3) {
		;
      if (str_word_count($text, 0) > $limit) {
          $words = str_word_count($text, 2);
          $pos = array_keys($words);
          $text = substr($text, 0, $pos[$limit]) . '...';
      }
      return $text;
}*/

?>
<?php if ( isset($review) && !empty($review) ) :?>
<div id="view-review" class="box">
	<div class="box-caption-movable">
		<?php echo $a_Lang['Latest_Review'];?>
	</div>
	<div class="box-content-movable">
		<?php foreach ( $review as $a_Row ) : ?>
		<ul>
			<li><font><?php echo $a_Row['Review']['name']?></font><br> <?php 
					$i_MaxEn = $a_Row['Review']['rate'];
					$i_MaxDis = 5 - $i_MaxEn;
				?>
				<?php for( $i = 0; $i < $i_MaxEn; $i ++ ) :?>
					<img src="<?php echo SITE_WEBROOT; ?>img/stars_enabled.png" width="15"/>
				<?php endfor;?>
				<?php for( $i = 0; $i < $i_MaxDis; $i ++ ) :?>
					<img src="<?php echo SITE_WEBROOT; ?>img/stars_disabled.png" width="15"/>
				<?php endfor;?><br>
				<?php echo limit_text($a_Row['Review']['content'])?></li>
		</ul>
		<br>
		<?php endforeach;?>
	</div>
</div>
<style>
	#view-review ul {padding-left: 0px}
	#view-review ul li {list-style: none;}
	#view-review ul li font {font-style: italic; color: blue}
</style>
<?php endif;?>
